package vip.xiaonuo.sys.modular.question.controller;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import vip.xiaonuo.sys.modular.question.entity.PageData;

import javax.servlet.http.HttpServletRequest;

/**
 * 说明：所有处理类父类
 * 作者：FH Admin Q313596790
 * 官网：www.fhadmin.org
 */
public class BaseController {

	/**
	 * new PageData对象
	 * @return
	 */
	public PageData getPageData() {
		return new PageData(this.getRequest());
	}

	/**
	 * 得到request对象
	 * @return
	 */
	public HttpServletRequest getRequest() {
		HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
				.getRequest();
		return request;
	}


}
